<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="//cdn.bootcss.com/jquery/2.0.2/jquery.min.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/admin.css">
    <style>
        body{overflow-y: auto;font-size: 13px;}
    </style>
</head>
<body>
<div class="hw-content" style="padding: 20px;">
    <form class="am-form am-form-horizontal" action="{:U('Member/postexcel')}" method="post" id="from1" enctype="multipart/form-data">

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">选择会议</div>
            <div class="am-u-sm-9 am-u-md-3 am-u-end col-end">
                <select  data-am-selected style="display: none;" name="cid">
                    <volist name="clist" id="vo">
                        <eq name="vo.id" value="$data.cid">
                            <option value="{$vo.id}" selected>{$vo.name}</option>
                            <else />
                            <option value="{$vo.id}">{$vo.name}</option>
                        </eq>
                    </volist>
                </select>
            </div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">Excel</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end am-form-file">
                <button type="button" class="am-btn am-btn-default am-btn-sm"><i class="am-icon-cloud-upload"></i> 选择要上传的文件Excel</button>
                <input type="file" name="excel" multiple id="file-excel">
                <div id="file-excel-name"></div>
            </div>
            <script>
                $(function() {
                    $('#file-excel').on('change', function() {
                        var fileNames = '';
                        $.each(this.files, function() {
                            fileNames += '<span class="am-badge">' + this.name + '</span> ';
                        });
                        $('#file-excel-name').html(fileNames);
                    });
                });
            </script>
        </div>

        <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-8 am-u-sm-offset-3">
                <button type="button" class="am-btn am-btn-primary">添加参会人员</button>
            </div>
        </div>



    </form>
    <div style="clear: both"></div>
</div>

<!--[if lt IE 9]>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<![endif]-->
<script src="http://malsup.github.io/jquery.form.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.ie8polyfill.min.js"></script>
<script src="__PUBLIC__/resource/layer/layer.js"></script>
<script src="__PUBLIC__/resource/layer/laydate.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/resource/assets/js/hw-layer.js"></script>
<script src="__PUBLIC__/resource/assets/js/app.js"></script>
<script>
    // 恢复 jQuery Form 插件的 $.fn.selected，
    // 并把 Amaze UI selected 重新赋值给 $.fn.amSelected
    //$.fn.amSelected = $.fn.selected.noConflict();

    // 使用 Amaze UI 的 selected
    //$('[data-am-selected]').amSelected();

    $(".am-btn-primary").click(function () {
        $('#from1').ajaxSubmit(function(data){
            $temp = $.parseJSON(data)
            if($temp['status'] == "200"){
                layer.msg($temp['text'],{icon:1,time:1000},function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.location.reload()
                    parent.layer.close(index);
                })
            }else{
                layer.msg($temp['text'],{icon:2,time:1000});
            }
        });
    })
</script>
</body>
</html>
